package com.wesley.visitor;

import java.util.LinkedList;
import java.util.List;

/**
 * <h1>概述</h1>
 * <p>详述</p>
 *
 * @Date: 2021/9/1
 */
public class ObjectStructrs {

    private final List<Person> personList = new LinkedList<>();

    public void add(Person person) {
        personList.add(person);
    }

    public void delete(Person person) {
        personList.remove(person);
    }

    public void show(Action action) {
        personList.forEach(person -> person.accept(action));
    }
}
